package com.wench.design.pattern.command;

import java.util.Map;

/**
 * 具体的命令类
 *
 * @author wench
 */
public class OrderCommand implements Command{

    private SeniorChef receiver;
    private Order order;

    public OrderCommand(SeniorChef receiver, Order order) {
        this.receiver = receiver;
        this.order = order;
    }

    @Override
    public void execute() {
        System.out.println(order.getDiningTable() + " 桌的订单：");
        Map<String, Integer> foodDic = order.getFoodDic();
        for (String foodName : foodDic.keySet()) {
            receiver.makeFood(foodDic.get(foodName), foodName);
        }
        System.out.println(order.getDiningTable() + " 桌的饭菜准备完毕！！！");
    }
}
